surface: Store popup parent
authorMatthias Clasen <mclasen@redhat.com>
Mon, 22 Apr 2019 14:21:17 +0000 (14:21 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:14 +0000 (20:25 +0000)
Store popup parents separately from transient-for
parents, since these are separate concepts with
different behaviors. And we need the parent in
the frontend, so we can use it in the fallback
move-to-rect implementation.

gdk/broadway/gdksurface-broadway.c
gdk/gdksurfaceprivate.h
gdk/wayland/gdksurface-wayland.c
gdk/x11/gdksurface-x11.c

index 67e8de7e4b25b046cdfae8f6a6a76c0e59acd773..c8ed7e4991d92e3e29ecf3737ca4905cae72f885 100644 (file)
@@ -208,6 +208,7 @@ _gdk_broadway_display_create_surface (GdkDisplay     *display,
   g_object_unref (frame_clock);
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;
index f2855ae996613638d74e906bb2e068eaeb594108..25319c6b38fc087772a8c1cc45a46111d5b83c61 100644 (file)
@@ -32,7 +32,8 @@ struct _GdkSurface
 
   GdkDisplay *display;
 
-  GdkSurface *transient_for;
+  GdkSurface *transient_for; /* for toplevels */
+  GdkSurface *parent;        /* for popups */
 
   gpointer widget;
 
index bf167354c863c181694f85f1c48c46716701d90b..e11f9dceb90ed791e362ab5c8d494c4513161c32 100644 (file)
@@ -531,6 +531,7 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
     }
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;
index f5f8886544be2426ec84f02737eaca6a8702fa41..0643948ec25554f6c7e9cb0950e94a47839aaa60 100644 (file)
@@ -811,6 +811,7 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
   g_object_unref (frame_clock);
 
   surface->surface_type = surface_type;
+  surface->parent = parent;
   surface->x = x;
   surface->y = y;
   surface->width = width;